package com.hunttown.common.sharding.client.config;

import com.hunttown.common.sharding.client.rule.function.Function;
import com.hunttown.common.sharding.client.rule.function.Hash;

import java.util.HashMap;
import java.util.Map;

public class FunctionRegistry {
    public static final String HASH_FUNC_NAME = "hash";
    private static final Map<String, Function> funcMap = new HashMap(2);

    public FunctionRegistry() {
    }

    public static Function getFunction(String funcName) {
        return (Function) funcMap.get(funcName);
    }

    static {
        funcMap.put("hash", new Hash());
    }
}